package com.ruoyi.kjy.domain;

//import cn.easyes.annotation.IndexField;
//import cn.easyes.annotation.IndexId;
//import cn.easyes.annotation.IndexName;
//import cn.easyes.common.constants.Analyzer;
//import cn.easyes.common.enums.FieldType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.mp.domain.CommonEntity;
import com.ruoyi.common.mp.handle.ListToStringHandle;
import com.ruoyi.system.api.domain.SysUser;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 科技成果管理对象 achievement
 *
 * @author ruoyi
 * @date 2023-04-06
 */
@Data
@TableName(autoResultMap = true)  //BaseTypeHandler 配置
public class Achievement extends CommonEntity {
    private static final long serialVersionUID = 1L;
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("创建时间")
   // @IndexId(type = cn.easyes.common.enums.IdType.CUSTOMIZE)
    private Long id;

    @TableField(exist = false)
    //@IndexField(exist = false)
    private String searchWord;
    @TableField(exist = false)
    //@IndexField(exist = false)
    private SysUser user;
    /**
     * 行业领域
     */
    @Excel(name = "行业领域")
    @ApiModelProperty("行业领域")
    @TableField(typeHandler = ListToStringHandle.class)
   // @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_SMART)
    private List<String> industrySector;

    /**
     * 专利情况
     */
    @Excel(name = "专利情况")
    @ApiModelProperty("专利情况")
    private String patentsType;

    /**
     * 成熟度
     */
    @Excel(name = "成熟度")
    @ApiModelProperty("成熟度")
    private String maturity;

    /**
     * 合作意向
     */
    @Excel(name = "合作意向")
    @ApiModelProperty("合作意向")
    private String cooperationIntention;

    /**
     * 关联组织
     */
    @Excel(name = "关联组织")
    @ApiModelProperty("关联组织")
    private String associatedOrganizations;

    private Integer state;

    private String failedReason;

    @ApiModelProperty("内容")
    //@IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_SMART)
    private String content;

    @ApiModelProperty("题目")
    //@IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_SMART)
    private String title;

    @ApiModelProperty("作者id")
    //@IndexField(fieldType = FieldType.LONG)
    private Long author;

    @ApiModelProperty("作者姓名")
    //@IndexField(fieldType = FieldType.TEXT)
    private String authorName;

    @ApiModelProperty("所在地")
    @TableField(typeHandler = ListToStringHandle.class)
    //@IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_SMART)
    private List<String> location;

    @ApiModelProperty("专利号")
    private String patentNumber;

    @ApiModelProperty("专利授权时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //@IndexField(fieldType = FieldType.DATE)
    private Date authorizationTime;

    @ApiModelProperty("发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //@IndexField(fieldType = FieldType.DATE)
    private Date releaseTime;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //@IndexField(fieldType = FieldType.DATE)
    private Date createTime;
    @ApiModelProperty("年份")
    private String contractYear;
    @ApiModelProperty("合同编号")
    private String contractCode;
    @ApiModelProperty("技术交易额（元）")
    private String contractVolume;
    @ApiModelProperty("合同类别")
    private String contractType;
    @ApiModelProperty("买方名称")
    private String contractBuyer;
    @ApiModelProperty("城市")
    @TableField(typeHandler = ListToStringHandle.class)
    private List<String> contractCity;
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<file> files;
    @Data
    public static class file{
        String name;
        String url;

        public file(String name, String url) {
            this.name = name;
            this.url = url;
        }

        public file() {
        }
    }
}
